package ctime

import (
	"fmt"
	"gitee.com/theegg/go-brick/app/service/app"
	"time"
)

// 字符串转时间戳
func StrTimeToInt64(strTime string) (int64, error) {
	timezone, _ := time.LoadLocation("Asia/Shanghai")
	theTime, err := time.ParseInLocation("2006-01-02 15:04:05", strTime, timezone)
	if err != nil {
		fmt.Print(err)
		return 0, app.NewError(err)
	}
	return theTime.Unix(), nil
}
